public class SpawnFrame{
	
	private static int SpawnX = -2020;
	private static int Spawny = 50;	
	
	//Spawnt Gegner in einem Raster
	public static void AlienSpawnGrid(int[] spawnsLevel){
		for(int i = 0; i < spawnsLevel.length; i++){
			if(i < 10){
				LevelSpawns(spawnsLevel[i],(SpawnX+2100)+(i*40), Spawny);
			}else if(i < 20){
				LevelSpawns(spawnsLevel[i],(SpawnX+1700)+(i*40), Spawny+40);
			}else if(i < 30){
				LevelSpawns(spawnsLevel[i],(SpawnX+1300)+(i*40), Spawny+80);
			}else if(i < 40){
				LevelSpawns(spawnsLevel[i],(SpawnX+900)+(i*40), Spawny+120);
			}else if(i < 50){
				LevelSpawns(spawnsLevel[i],(SpawnX+500)+(i*40), Spawny+160);
			}
		}
	}
	
	//Zuweisung der Grafiken zu den Werten des Spawn Templates(SpawnLevels.java)
	public static AlienEntity LevelSpawns(int SpawnTable, double x, double y){
		if(SpawnTable == 1){
			AlienEntity alien = new AlienEntity("images/invader1.png", x, y, 0);
			EntityManager.entitylist.add(alien);
			alien.setHorizontalMovement(20+(GamePanel.gp.Level*5));
			return(alien);
		}else if(SpawnTable == 2){
			AlienEntity alien = new AlienEntity("images/invader2.png", x, y, 0);
			EntityManager.entitylist.add(alien);
			alien.setHorizontalMovement(20+(GamePanel.gp.Level*5));
			return(alien);
		}else if(SpawnTable == 3){
			AlienEntity alien = new AlienEntity("images/invader3.png", x, y, 0);
			EntityManager.entitylist.add(alien);
			alien.setHorizontalMovement(20+(GamePanel.gp.Level*5));
			return(alien);
		}else if(SpawnTable == 4){
			AlienEntity alien = new AlienEntity("images/boss.png", x, y, GamePanel.gp.Level);
			EntityManager.entitylist.add(alien);
			alien.setHorizontalMovement(20+(GamePanel.gp.Level*5));
			return(alien);
		}else return null;
	}

}
